package com.haizhi.crm.api.controller.hisview;

import com.haizhi.crm.biz.service.HistoryViewService;
import com.haizhi.crm.common.model.Response;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by yangyijun on 2018/6/14.
 */
@Api(description = "[业务-浏览历史]" )
@RestController
@RequestMapping("/historyView" )
public class HistoryViewController {

    @Autowired
    private HistoryViewService historyViewService;

    @ApiOperation(value = "公用-最近浏览", notes = "limit 为topn。 entityType，可选值：Company（客户）；tv_outer_event（行外事件）；tv_inner_event（行内动态）；tv_product（产品）" )
    @GetMapping(value = "/recentView" )
    public Response recentView(String entityType, @RequestParam Integer limit) {
        return historyViewService.recentView(entityType, limit);
    }
}
